from mapper.user_mapper import UserMapper

class UserService:
    @staticmethod
    def get_users():
        return [user.to_dict() for user in UserMapper.get_all_users()]

    @staticmethod
    def get_user(user_id):
        user = UserMapper.get_user_by_id(user_id)
        return user.to_dict() if user else None

    @staticmethod
    def add_user(username, email):
        return UserMapper.create_user(username, email).to_dict()

    @staticmethod
    def remove_user(user_id):
        return UserMapper.delete_user(user_id)
